#include <stdio.h>
#include <omp.h>

int main(int argc, char* argv[])
{
    int i;
	// YOUR CODE HERE
	//#pragma omp parallel for 
    #pragma omp parallel for num_threads(6) 
	// END OF YOUR CODE
	for (i = 0; i < 10; i++) {
		printf("i = %d\n", i);
        //通过打印线程号，可以知道 #pragma omp parallel for num_threads(6) 可以
        //启动6个线程处理for循环，并打印线程号
        printf("OpenMP Test, 线程编号为: %d\n", omp_get_thread_num()); 
	}
	return 0;
}

/*
编译： gcc -fopenmp  1.OpenMP介绍.c
*/